package ControlLayer;
import java.sql.SQLException;
import ModelLayer.*;
import DBLayer.*;
public class CtrInvoice {
	public void createInvoice(int invoiceNo, int saleID, double amount, int discount, int delivery, String paymentDate){
		IFDBInvoice dbInvoice = new DBInvoice();
		Invoice invoiceObj = new Invoice();
		invoiceObj.setinvoiceNo(invoiceNo);
		invoiceObj.setamount(amount);
		invoiceObj.setdiscount(discount);
		invoiceObj.setdelivery(delivery);
		invoiceObj.setpaymentDate(paymentDate);
		try{
			dbInvoice.createInvoice(invoiceObj);
		}catch(SQLException sql){
			System.out.println("SQLException in ctrInvoice: "+sql);
			sql.printStackTrace();
		}
	}
}